<?php
/**
 * Created by PhpStorm.
 * User: dell
 * Date: 2018/5/29
 * Time: 20:00
 */

namespace app\model;


class Video_templet extends Model
{
    public function __construct($db)
    {
        parent::__construct($db, "templet_video");
        $this->templet_video="templet_video";
        $this->template_photo="template_photo";
        $this->template_photo_no_edit="template_photo_no_edit";
    }

    /**
     * 查询所有视频
     */
    public function get_video_templet(){
        $this->db->select("*");
        $this->db->from($this->templet_video);
        $this->db->where(["online" => 2]);
        $query = $this->db->get();
        $datas = $query->all();
        $data["data"] = $datas;
//        echo $this->db->last_query();exit;
        return $data["data"];
    }

    /**
     * 查询配配配所有相框模板
     */
    public function all_tempalte_photo(){
        $this->db->select("id,photo_frame_title,xiaoguo_url,moban_url");
        $this->db->from($this->template_photo);
        $this->db->where(["photo_online" => 2]);
        $this->db->order_by(["add_time","desc"]);
        $query = $this->db->get();
        $datas = $query->all();
        $data["data"] = $datas;
//        echo $this->db->last_query();exit;
        return $data["data"];
    }

    /**
     * 查询所有相框模板
     */
    public function all_tempalte_photo_no_edit(){
        $this->db->select("id,photo_frame_title,xiaoguo_url,moban_url");
        $this->db->from($this->template_photo_no_edit);
        $this->db->where(["photo_online" => 2]);
        $this->db->order_by(["add_time","desc"]);
        $query = $this->db->get();
        $datas = $query->all();
        $data["data"] = $datas;
//        echo $this->db->last_query();exit;
        return $data["data"];
    }


}